
# ifndef __DFX_WINDOW_WIN32_H__
# define __DFX_WINDOW_WIN32_H__

# include "dfxWindow.h"
# include "dfxLog.h"
# include <Windows.h>

namespace DFX
{
    LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

    class Window_Win32 : public Window
    {
    private:

        HWND            mHWND;
        HDC             mHDC;
        HGLRC           mRC;
        HINSTANCE       mInstance;
        RECT            mRect;
        RAWINPUT        *mRawInput;

        friend LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

    public:

        Window_Win32(const String &name, const String &className);
        ~Window_Win32();

        HWND GetHWND() const
        {
            return mHWND;
        }

        HDC GetHDC() const
        {
            return mHDC;
        }

        HGLRC GetRC() const
        {
            return mRC;
        }

        HINSTANCE GetInstance() const
        {
            return mInstance;
        }

        RAWINPUT* GetRawInput() const
        {
            return mRawInput;
        }

        void SetClassName(const String &className)
        {
            mClassName = className;
        }

        void SetRC(HGLRC hRC)
        {
            mRC = hRC;
        }

        DFXRESULT Create(UInt32 handle, UInt32 width, UInt32 height);
        DFXRESULT Create(WINDOW_PARAMETERS *parameters);
        DFXRESULT Destroy();

        void SetTitle(const String &title);
        void Show();
        void SwapBuffers();

        void SetKeyboard(Keyboard *k);
    };
}

# endif